<?php
use yii\helpers\Html;
use yii\helpers\Url;
/* @var $this \yii\web\View */
/* @var $content string */

//\frontend\assets\MktWapCommonAsset::register($this);
?>
<script type="text/javascript">

function ignorePostResponse(id) {
	var args = {
		'classname': '\\common\\models\\MktPostResponse',
		'funcname': 'ignorePostResponseAjax',
		'params': {
			'id':id,
		}
	};

    $.ajax({
        url: "<?= Url::to(['/wap/ajax-broker']); ?>",
        type: "GET",
        cache: false,
        dataType: "json",
        data: "args=" + JSON.stringify(args),
        success: function (resp) {
            if (resp['code'] != 0) {
                alert("handle error");
                return;
            }
            location.reload();
        },
        error: function () {
            //alert('send error');
        }
    });
}

function applyAddFriend(friend_id) {
    var args = {
        'classname': '\\common\\models\\MktUser',
        'funcname': 'addFriendAjax',
        'params': {
            'user_id' : <?php echo \common\wosotech\Util::getSessionUserId(); ?>,
            'friend_id': friend_id
        }
    };

    frmwebm.confirm({
        title:"加好友",
        content:"将消耗10积分<br>72小时内，对方如果没有反应，10积分将返回您的账户。",
        url: "<?= Url::to(['/wap/ajax-broker']); ?>",
        type: "GET",
        data: "args=" + JSON.stringify(args),
        successFunc: function (resp) {
            if (resp['code'] != 0) {
                frmwebm.prompt({
                    title: "友情提示",
                    content: resp['data']
                });
                return;
            }
            frmwebm.prompt({
                title: "成功发送好友申请",
                content: "已冻结10个金币...",
                reload: true
            });
        },
        errorFunc: function () {
            //alert('send error');
        },
        //reload: true
        //afterClose: null,
    });
}

function gotoProfile(id)
{
    window.location.href = "<?php echo Url::to(['market-profile']); ?>&id=" + id;
}


</script>


<section class="page scr-page">
<div class="weui_panel weui_panel_access">
	<div class="weui_panel_bd">

        <?php echo yii\widgets\ListView::widget([
            'dataProvider' => $dataProvider,
            'itemView' => '_message_item',
            'viewParams' => ['me' => $me],
            'layout' => "{items}\n{pager}\n",
            'emptyText' => '<div style="text-align:center;margin-top: 100px;"><span style="color:#666666 !important;margin-top: 150px;">你还没有发布过贴子<br><a href="' . Url::to(['/wap/post-add']) . '">现在就去发布一篇吧&gt;</a></span></div>',

            'pager' => [
                'firstPageLabel' => false,
                'lastPageLabel' => false,
                'prevPageLabel' => '上页',
                'nextPageLabel' => '下页',
                'maxButtonCount' => 0,
            ],

        ]) ?>

		
		<div class="weui_media_box weui_media_appmsg"></div>
	</div>
</div>
<div style="width:100%;height:55px;"></div>
</section>

<?php
/*
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img style="margin-top: -15px;" class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_box weui_media_text" style="width:100%;">
				<div onclick="gotoManDetail(1)" class="weui_media_title"><span class="name" style="color:#1e1e1e !important;">肖丽芳</span>天才宝贝光谷店中心主任</div>
				<div style="float:right;">
					<input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="忽略"></input>
					<input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="加好友"></input>
				</div>
				
				<div class="weui_media_desc" style="color:#bbbfb2;padding-top:0px;line-height:20px;height:20px;margin-bottom: 8px;">8-21 响应</div>
				<div class="weui_media_title"><span class="name" style="color:#666666 !important;margin-top: 2px;">招聘市场经理</span></div>
			</div>
		</a>
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img style="margin-top: -15px;" class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_box weui_media_text" style="width:100%;">
				<div onclick="gotoManDetail(1)" class="weui_media_title"><span class="name" style="color:#1e1e1e !important;">王可五个字</span>艺米沙画总经理</div>
				<div style="float:right;">
					<input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="忽略"></input>
					<input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="加好友"></input>
				</div>
				<div class="weui_media_desc" style="color:#bbbfb2;padding-top:0px;line-height:20px;height:20px;margin-bottom: 8px;">8-12 响应</div>
				<div class="weui_media_title"><span class="name" style="color:#666666 !important;margin-top: 2px;">寻沙画表演师</span></div>
			</div>
		</a>

*/